package com.dolittle.template;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

public class MenuTemplateView extends LinearLayout {
	private Button[] mButtons;
	private MenuActivity mMenuActivity;

	public MenuTemplateView(Context context, MenuActivity menuActivity) {
		super(context);
		mMenuActivity = menuActivity;
		initButtons();

	}

	private void initButtons() {
		mButtons = new Button[2];
		mButtons[0] = new Button(this.getContext());
		mButtons[1] = new Button(this.getContext());
		mButtons[0].setText("New game");
		mButtons[1].setText("Exit");
		mButtons[0].setClickable(true);
		mButtons[1].setClickable(true);
		LayoutParams param = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);
		LayoutParams param1 = new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT);

		//mButtons[0].setLayoutParams(param);
		//mButtons[1].setLayoutParams(param1);
		
		mButtons[1].setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				mMenuActivity.finish();
			}
		});
		mButtons[0].setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				v.setBackgroundColor(Color.GREEN);
			}
		});
		
//		addView(mButtons[0]);
//		addView(mButtons[1]);
		addView(mButtons[0], param);
		addView(mButtons[1], param1);
		//setGravity(VERTICAL);
		
	}

}
